using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Game;
using NetProtocol.POD;
using System.Collections.Generic;

namespace IQIGame.Onigao.GamePlay
{
    public class UD_ItemGet : UIBaseData
    {
        public List<ItemShowData> showList;

        public static UD_ItemGet Create(List<ItemShowPOD> podList)
        {
            UD_ItemGet d = ClassPool<UD_ItemGet>.Get();
            d.showList = ListPool<ItemShowData>.Get();
            ItemModule.Instance.ConvertListFrom(podList, d.showList);
            return d;
        }

        #region pool

        public override void OnReset()
        {
            if (showList.Count > 0)
            {
                foreach (var item in showList)
                {
                    item.Put2Pool();
                }
                ListPool<ItemShowData>.Put(showList);
                showList = null;
            }
        }
        #endregion
    }
}
